all:
	cd src && make && cd ..
	make install
	make test_qemu
	
clean:
	cd src && make clean  && cd ..
	rm -r isofiles
	rm image.iso

install:
	mkdir isofiles
	mkdir isofiles/boot/
	mkdir isofiles/boot/grub/
	cp grub/stage2_eltorito isofiles/boot/grub
	cp src/kernel/kernel isofiles/
	cp src/menu.lst isofiles/boot/grub
	cp logo/grub.xpm.gz isofiles/
	src/tools/initramfs_gen/initramfs_gen src/tools/initramfs_gen/initram.img src/initr/*

	cp src/tools/initramfs_gen/initram.img isofiles/

	mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o image.iso isofiles

	rm -r isofiles


test_bochs:
	bochs -f bochs.rc

test_qemu:
	qemu -cdrom image.iso -soundhw sb16,adlib -usb -net nic -m 128

src:
	cd src && make && cd ..
